<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.fick.hibernate.model.*"%>
<%@ page import="com.fick.hibernate.dao.*"%>
<%@ include file="../tld/tlds.jsp"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>在线调查选项</title>
<link href="images/jiahao.css" rel="stylesheet" type="text/css">

		<link href="css/css.css" rel="stylesheet" type="text/css" />
		<script language="JavaScript" src="js/meihuaxue.js"></script>
		<script language="javaScript" src="js/prototype.js"></script>
		<script type="text/javascript" src="js/submit.js"></script>
		
</head>

<body>
<%
	VoteinfoDAO dao=new VoteinfoDAO();
	Voteinfo voteinfo;
	List li2 = dao.findBySql(Voteinfo.class,"where vote.investId="+request.getParameter("voteid")+" order by voteinfoId desc");
		 %>

<table width="100%"  height="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="100%" align="center" valign="top" background="images/main_bj.gif" bgcolor="#FBFCFD"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="23" align="left" valign="middle" background="images/main_top.gif"><table border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="20" height="23">&nbsp;</td>
            <td width="400" height="23" align="left" valign="middle" class="ts_lmdh2">在线调查选项管理 </td>
          </tr>
        </table></td>
      </tr>
    </table>
      <table width="98%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="20" align="left"><input type="button" value="添加在线调查选项" onclick="window.location.href='addVoteinfo.jsp?voteid=<%=request.getParameter("voteid") %>'"></td>
        </tr>
      </table>
      <table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#D7DFE1">
      <thead>
      <td colspan="2" align="center" style="font-size:15px" width="100%"><b>
      
          <%
          if(request.getParameter("voteid")!=null && request.getParameter("voteid").trim().length()>0){
        	  Vote vote=new VoteDAO().findById(Integer.parseInt(request.getParameter("voteid")));
        	  out.println(vote.getQuestion());
          }
          %></b>
      </td>
      </thead>
        <tr>
		 <td width="6%" height="25" align="center" valign="middle" background="images/main_t_bj.gif" bgcolor="#FFFFFF" class="ts_lmdh">选择</td>
          <td width="37%" height="25" align="center" valign="middle" background="images/main_t_bj.gif" bgcolor="#FFFFFF" class="ts_lmdh">选项名</td>
		 <td width="6%" height="25" align="center" valign="middle" background="images/main_t_bj.gif" bgcolor="#FFFFFF" class="ts_lmdh">选择次数</td>
          <td width="20%" height="25" align="center" valign="middle" background="images/main_t_bj.gif" bgcolor="#FFFFFF" class="ts_lmdh">操作</td>
        
        </tr>
       
	   <%
		for(int i = 0 ; i < li2.size(); i++){
			voteinfo = (Voteinfo)li2.get(i);
										      
	 %>
	    <tr>
		<td width="6%" height="25" align="center" valign="middle" bgcolor="#FFFFFF">
		<input type="checkbox" name="MyCheckBox" id="MyCheckBox"
													value="<%=voteinfo.getVoteinfoId() %>" />
		</td>
          <td width="37%" height="25" align="left" valign="middle" bgcolor="#FFFFFF" style="padding-left:7px">
		  <%=voteinfo.getVoteinfoName()%>
		  </td>
  			<td width="10%" height="25" align="center" valign="middle" bgcolor="#FFFFFF">
			<%= voteinfo.getVoteinfoClickNum() %>
			</td>
  			<td width="10%" height="25" align="center" valign="middle" bgcolor="#FFFFFF">
			<a href="addVoteinfo.jsp?id=<%=voteinfo.getVoteinfoId() %>&voteid=<%=request.getParameter("voteid") %>">修改</a>&nbsp;
			<a href="<%=request.getContextPath()%>/admin/voteinfo.do?method=delById&id=<%=voteinfo.getVoteinfoId() %>&voteid=<%=request.getParameter("voteid") %>">删除</a>
			</td>
        </tr>
      <%
	  }
	  %>
	  
	  <tr>
		<td colspan="4" align="left">
		<input type="button" name="selectAlls" id="selectAlls" value="全选" onclick="return selectAll()" />
		<input type="button" name="noSelectAll" id="noSelectAll" value="反选" onclick="return selectOthers();" />
		<input type="button" name="cancelSelects" id="cancelSelects" value="取消选择" onclick="return cancelSelect();" />
		<input type="button" name="delAlls" id="delAlls" value="删除所选" onclick="return delAll('/admin/voteinfo.do?method=delAll&voteid=<%=request.getParameter("voteid") %>&str=');"/>
		</td>
	</tr>
	  
	  </table>
	  
	  
	  
	  </td>
  </tr>
</table>
</body>
</html>
<script language="javascript">
 function gopage(selected)
 {
 	window.open(selected.value,"_self");
 }
 </script>